﻿using System.Text.RegularExpressions;

namespace ArienToolkits.Validator
{
    /// <summary>
    /// 正则表达式验证器(为了偷懒写的，仅限程序集内部调用，不对外公开)
    /// </summary>
    internal class RegexValidator
    {
        /// <summary>
        /// 验证表达式与内容是否匹配
        /// </summary>
        /// <param name="partten"></param>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool Validate(string partten, string str)
        {
            Regex regex = new Regex(partten);
            return regex.Match(str).Success;
        }
    }
}
